package org.gen.code.gen.service.impl;


import org.gen.code.gen.dao.CodeDao;
import org.gen.code.db.domain.DbConfig;
import org.gen.code.gen.domain.TableInfo;
import org.gen.code.gen.service.CodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 代码生成实现层
 */
@Service
public class CodeServiceImpl implements CodeService {
    @Autowired
    private CodeDao codeDao;

    @Override
    public List<TableInfo> getAllTables(DbConfig dbConfig) {
        return codeDao.getAllTables(dbConfig);
    }

    @Override
    public TableInfo getAllColumns(String tableName, DbConfig dbConfig) {
        return codeDao.getAllColumns(tableName, dbConfig);
    }

    @Override
    public void saveComment(TableInfo tableInfo, DbConfig dbConfig) {
        codeDao.saveComment(tableInfo, dbConfig);
    }

    @Override
    public String testConnection(DbConfig dbConfig) {
        return codeDao.testConnection(dbConfig);
    }

}
